﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LogIn.aspx.cs" Inherits="Cognitum.Presentacion.LogIn" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>:: cognιтυм ::</title>
    <style type="text/css">
        #form1
        {
            width: 330px;
        }
    </style>
    <script>
    // <!--
    	function load() {
			var nameEQ = "cognitum.com=";
			var ca = document.cookie.split(';');
			for(var i=0;i < ca.length;i++) {
				var c = ca[i];
				while (c.charAt(0)==' ') c = c.substring(1,c.length);
				if (c.indexOf(nameEQ) == 0) {
					var value = c.substring(nameEQ.length,c.length);
					value = value.split('$');
					this.username = value[0];
					this.password = value[1];
					this.ubicacion = value[2];
					this.recordar = true;
				}
			}
    	}
    	
        function check() {
        	var recordar = false;
			if(recordar) {
				var username = Ext.get('txtUsuario').getValue();
				var password = Ext.get('txtPassword').getValue();
				var dominio = Ext.get('txtDominio').getValue();

				var expires = new Date(new Date().getTime()+(1000*60*60*24*30));
				var value = username + '$' + password + '$' + dominio;
				document.cookie = 'Karma.com=' + value + '; expires=' + 
					expires.toGMTString() + '; path=/';
			} else {
				document.cookie = 'cognitum.com=; expires=-1; path=/';
			}
        }
    // -->
	</script>
</head>
<body style="background-position: center center; background-image: url('imgs/background1.jpg'); background-repeat: no-repeat;
    background-attachment: fixed;  background-color: gray; border-width: 0px; padding: 0px; margin: 0px" onLoad="javascript:load();">
    <table width="99%" border="0" cellpadding="0" cellspacing="0">
        <tbody>
            <tr>
                <td style="width:30%;">
                    &nbsp;
                </td>
                <td align="center" valign="bottom">
                        <form id="form1" runat="server" onsubmit="javascript:check();">
                        <table border="0" cellpadding="0" cellspacing="4" width="100%" 
                        style="padding: 0px; margin: 0px; border-width: 0px; width: 390px; background-image: url('lib/ext/resources/images/default/shadow-c.png');
                        background-repeat: repeat; font-family: Verdana; color: #FFFFFF; position: absolute;
                        bottom: 150px; font-size: small; z-index: 1000; left: auto; right: auto;">
                            <tr><td colspan="2">&nbsp;</td></tr>
                            <tr>
                                <td colspan="2" align="center">
                                    <asp:Label ID="Label1" runat="server" Text="cognιтυм" Font-Size="Medium"></asp:Label>
                                    <p />
                                </td>
                            </tr>
                            <tr>
                                <td align="right">
                                    <asp:Label ID="Label2" runat="server" Text="Usuario"></asp:Label>
                                </td>
                                <td align="left">
                                    <asp:TextBox ID="txtUsuario" runat="server" BorderStyle="Groove" 
                                        BorderWidth="0px"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="UsuarioValidator" runat="server" 
                                        ErrorMessage="El usuario es campo mandatorio." 
                                        ControlToValidate="txtUsuario" ValidationGroup="loginGroup">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="right">
                                    <asp:Label ID="Label3" runat="server" Text="Contraseña"></asp:Label>
                                </td>
                                <td align="left">
                                    <asp:TextBox ID="txtPassword" runat="server" BorderStyle="Groove" 
                                        BorderWidth="0px" TextMode="Password"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="PasswordValidator" runat="server" 
                                        ErrorMessage="La contraseña es campo mandatorio." ControlToValidate="txtPassword" 
                                        ValidationGroup="loginGroup">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="right">
                                    <asp:Label ID="Label4" runat="server" Text="Ubicación"></asp:Label>
                                </td>
                                <td align="left">
                                    <asp:TextBox ID="txtUbicacion" runat="server" BorderStyle="Groove" 
                                        BorderWidth="0px"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="UbicacionValidator" runat="server" 
                                        ErrorMessage="La ubicación es campo mandatorio." ControlToValidate="txtUbicacion" 
                                        ValidationGroup="loginGroup">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr><td colspan="2" align="center">
                                <asp:CheckBox ID="chkRecordar" runat="server" Checked="True" 
                                    Text="Recordar mis datos" />
                                </td></tr>
                            <tr><td colspan="2">&nbsp;</td></tr>
                            <tr>
                                <td>&nbsp;</td>
                                <td align="center">
                                    <asp:Button ID="btnEntrar" runat="server" Text="Entrar" 
                                        style="margin-left: 0px" Width="88px" BorderStyle="Groove" 
                                        BorderWidth="1px" ValidationGroup="loginGroup" Height="23px" BackColor="White" />
                                </td>
                            </tr>
                            <tr><td colspan="2" align="center">
                                <asp:Label ID="Label5" runat="server" ForeColor="Red" 
                                    Text="* - Campos mandatorios"></asp:Label>
                                </td></tr>
                            <tr>
                                <td colspan="2">
                                    <asp:Label ID="lblMessage" runat="server" ForeColor="Red" Visible="False"></asp:Label>
                                </td>
                            </tr>
                        </table>
                        </form>
                </td>
                <td style="width:30%;">
                    &nbsp;
                </td>
            </tr>
        </tbody>
    </table>
</body>
</html>
